﻿
using RpcClient.Attr;

using RpcModular.Config;

using RpcModularModel.Resource;
using RpcModularModel.Resource.Model;

namespace RpcModular.Service
{
        [ClassLifetimeAttr(ClassLifetimeType.单例)]
        internal class ResourceService : IResourceService
        {

                public IResourceContainer GetContainer(string name, ResourceType type)
                {
                        if ((type & ModularConfig.UpRange) == type)
                        {
                                return new ResourceContainer(name, type);
                        }
                        return null;
                }

                public static void Submit(string name, ResourceType type, ResourceDatum[] list)
                {
                        new SyncResource
                        {
                                ResourceType = type,
                                ModularName = name,
                                Resources = list
                        }.SyncSend();
                }
        }
}
